<%-- 
    Document   : friends.jsp
    Created on : Apr 3, 2012, 1:53:22 AM
    Author     : Mr. Hung
--%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link href="images/favicon.ico" rel="shortcut icon" type="image/x-icon" media="all" />
        <link href="style.css" rel="stylesheet" type="text/css" />

        <title>Home</title>
    </head>
    <body>
        <!--        Now for testing new body code-->
        <c:import url="/header.jsp"/>
        <c:import url="/leftbar.jsp"/>

        <div id="wrapper">
            <div id="content_wrapper"><span class="top"></span><span class="bottom"></span>
                <div id="content">
                    <h2><font color="red">DeleteFriend message: ${message} </font></h2>
                    <h2>Friend List (${totalResults})</h2>
                    <c:if test="${fn:length(friendList) > 0}">

                        <table>
                            <c:forEach var="acc" items="${friendList}">
                                <tr>
                                    <td>
                                        <img scr="${acc.avatar}" height="100" width="100" >
                                    </td>
                                    <td>
                                        Username: ${acc.username}<br>
                                        Age: ${acc.age}<br>
                                        Gender: ${acc.gender}<br>
                                        School: ${acc.career.school}
                                    </td>
                                    <td>
                                        <form action="DeleteFriend">
                                            <input type="submit" value="Delete">
                                            <input type="hidden" name="friendId" value="${acc.accountId}">
                                        </form>
                                    </td>
                                </tr>
                            </c:forEach>
                        </table>
                    </c:if>
                    <c:if test="${fn:length(friendList) < totalResults}">
                        <form action="ViewFriendList">
                            <input type="submit" value="More Results">
                            <input type="hidden" name="numOfResults" value="${fn:length(friendList) + incrementOfResults}">
                        </form>
                    </c:if>
                </div> <!-- end of content -->

                <div id="sidebar">
                    <div class ="profile_box">
                        <a href="personal.jsp">
                            <h2 align="center">${account.username}</h2>
                        </a>
                        <a id="avatar" href="personal.jsp" >
                            <img src="images/shin.jpg" height="250" width="250"> 
                        </a>
                    </div>
                    <div class="news_box">
                        <a href="friends.jsp"> <h2 align="center">Friend list (${sessionScope.account.numOfFriends})</h2></a>
                        <table>
                                    <tr>
                                <td width="80">
                                    <a href="">
                                        <img src="images/shin.jpg" height="70" width="70">
                                    </a>
                                        </td>
                                <td valign="top">
                                    <a href="">Friend Name</a>
                                        </td>
                            </tr>
                            <tr>
                                <td width="80">
                                    <a href="">
                                        <img src="images/shin.jpg" height="70" width="70">
                                    </a>
                                        </td>
                                <td valign="top">
                                    <a href="">Friend Name</a>
                                        </td>
                                    </tr>
                                    <tr>
                                <td width="80">
                                    <a href="">
                                        <img src="images/shin.jpg" height="70" width="70">
                                    </a>
                                        </td>
                                <td valign="top">
                                    <a href="">Friend Name</a>
                                        </td>
                                    </tr>
                            <tr>
                                <td width="80">
                                    <a href="">
                                        <img src="images/shin.jpg" height="70" width="70">
                                    </a>
                                </td>
                                <td valign="top">
                                    <a href="">Friend Name</a>
                                </td>
                            </tr>
                            <tr>
                                <td width="80">
                                    <a href="">
                                        <img src="images/shin.jpg" height="70" width="70">
                                    </a>
                                </td>
                                <td valign="top">
                                    <a href="">Friend Name</a>
                                </td>
                            </tr>
                            </table>
                    </div>
                    <div class="cleaner"></div>  
                </div>

                <div class="cleaner"></div>
            </div>

            <div class="cleaner"></div>

        </div> <!-- end of content_wrapper -->

        <c:import url="/footer.jsp"/>

    </body>
</html>
